package studyguide.ch09.simple;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class SimpleCleanCanvas extends Canvas {

	protected void paint(Graphics g) {
		int screenWidth = getWidth();
		int screenHeight = getHeight();
		
		// Clear screen before painting
		g.setColor(255, 255, 255); // White
		g.fillRect(0, 0, screenWidth, screenHeight);

		// Write a message:
		g.setColor(0, 0, 0); // Black
		g.drawString(
				"SimpleCleanCanvas: Screen clear!", 
				screenWidth/2, 
				screenHeight/4, 
				Graphics.TOP | Graphics.HCENTER);
	}

}
